﻿{include file="public/header"}
<title>问题修改</title>
</head>
<body>
<article class="page-container">
    <form action="" method="post" class="form form-horizontal" >
        <input type="hidden" value="{$data.id}" name="id">
        {if condition="$data['parent_id'] == 0"}
        <div class="ch-row ch-info-form">
            <div class="flex1">标题：</div>
            <div class="flex2">
                <input type="text"  name="title" class="title form-control" value="{$data.title}">
            </div>
        </div>
        {else}

        <div class="ch-row ch-info-form">
            <div class="flex1">标题：</div>
            <div class="flex2">
                <input type="text"  name="title" class="title form-control" value="{$data.title}">
            </div>
        </div>
        {/if}
        <div class="ch-row ch-info-form">
            <div class="flex1">
                <button class="btn btn-primary radius" style="width: 100%;" type="button"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
            </div>
        </div>
    </form>
</article>

{include file="public/footer"}
<script>
    $('.radius').click(function () {
        var src="{:Url('index/config/remote_edi')}";
        $.ajax({
            type: 'POST',
            url: src,
            dataType: 'json',
            data:$('form').serializeArray(),
            success: function (data) {
                var res=JSON.parse(data);
                if(res.code==200){
                    parent.location.reload();

                }else{
                    layer.msg(res.msg,{icon: 5,time:1000});
                }

            },
            error: function (data) {
                console.log(data.msg);
            },
        });



    });
</script>
</body>
</html>